﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using SCSService;
namespace SCS.Core.Models
{
    public class HomeMasterModel
    {
        public static List<Customer_Order> GetListOrder(int? status, DateTime? startDate, DateTime? endDate, int? siteGuid)
        {
            SCSService.InvoiceService InvoiceSvc = new InvoiceService();
            return InvoiceSvc.GetListOrder(status, startDate, endDate, siteGuid);
        }
        public static List<Detail_Order> GetListDetail(int? id)
        {
            SCSService.InvoiceService InvoiceSvc = new InvoiceService();
            return InvoiceSvc.CustomerOrderDetail(id);
        }
        public static void DeleteCustomerOrder(int typeId)
        {
            SCSService.InvoiceService InvoiceSvc = new InvoiceService();
            InvoiceSvc.DeleteCustomerOrder(typeId);
        }
        public static void DeleteOrder_Item_Detail(int? typeId)
        {
            SCSService.InvoiceService InvoiceSvc = new InvoiceService();
            InvoiceSvc.DeleteOrder_Item_Detail(typeId);
        }
        public static Customer_Order GetCustomer_OrdersByCustomerID(int CustomerID, int? siteGuid)
        {
            SCSService.InvoiceService InvoiceSvc = new InvoiceService();
            return InvoiceSvc.GetCustomer_OrdersByCustomerID(CustomerID, siteGuid);

        }
        #region Check ,Delete Product_Stock_Detail

        public static int checkedProduct_Stock_Detail(int? typeId)
        {
            SCSService.InvoiceService InvoiceSvc = new InvoiceService();
            return InvoiceSvc.GetCountProduct_Stock_Detail(typeId);
        }

        public static void UpdateStatusProduct_Stock_Detail(int? typeId, byte? status)
        {
            SCSService.InvoiceService InvoiceSvc = new InvoiceService();
            InvoiceSvc.UpdateStatusProduct_Stock_Detail(typeId, status);
        }
        public static void DeleteOrderItems(int? typeId)
        {
            SCSService.InvoiceService InvoiceSvc = new InvoiceService();
            InvoiceSvc.DeleteOrderItems(typeId);

        }
        public static void DeleteInvoice(int? typeId, byte? status)
        {
            SCSService.InvoiceService InvoiceSvc = new InvoiceService();
            InvoiceSvc.DeleteInvoice(typeId, status);
        }
        public static string GetProductNameID(int? typeID)
        {
            SCSService.InvoiceService InvoiceSvc = new InvoiceService();
            return InvoiceSvc.GetProductNameByID(typeID);

        }

        #endregion
        #region Order Items
        public static Order_Item GetOrder_ItemByID(int OrderItemID)
        {
            SCSService.InvoiceService InvoiceSvc = new InvoiceService();
            return InvoiceSvc.GetOrder_ItemByID(OrderItemID);
        }
        #endregion
        #region Popup shipment
        public static List<Shipment> GetListShipment(int? typeId)
        {
            SCSService.InvoiceService InvoiceSvc = new InvoiceService();
            return InvoiceSvc.GetListShipment(typeId);
        }
        public static Shipment GetShipmentByOrderID(int id)
        {
            SCSService.InvoiceService InvoiceSvc = new InvoiceService();
            return InvoiceSvc.GetShipmentByOrderID(id);
        }
        public static int GetStatusShipmnetByShipment(int OrderItemID)
        {
            SCSService.InvoiceService InvoiceSvc = new InvoiceService();
            return InvoiceSvc.GetStatusShipmnetByShipment(OrderItemID);
        }
        public static void InsertShipment_Item(Shipment_Item prtShipmentItem)
        {
            SCSService.InvoiceService InvoiceSvc = new InvoiceService();
            InvoiceSvc.InsertShipment_Item(prtShipmentItem);
        }
     
        #endregion
        #region Shipment_items
        public static void DeleteShipment_Item(int ShipmentID,int OrderItemID)
        {
            SCSService.InvoiceService InvoiceSvc = new InvoiceService();
            InvoiceSvc.DeleteShipment_Item(ShipmentID, OrderItemID);
        }
        #endregion

    }
}